package com.lc.analyze.config;

import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.iai.v20200303.IaiClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: some desc
 * @author: LChuang
 * @date: 2023/9/4 15:25
 */
@Configuration
public class TencentConfig {

    private final String secretId = "AKIDQedcNtBF4f2HI5ey2ygBfy4vYw61iANM";

    private final String secretKey = "oPltmRs41kEUVIGzTjkX5OSKzRghV6Vk";


    @Bean
    public IaiClient init(){
        Credential cred = new Credential(secretId, secretKey);
        // 实例化一个http选项，可选的，没有特殊需求可以跳过
        HttpProfile httpProfile = new HttpProfile();
        httpProfile.setEndpoint("iai.tencentcloudapi.com");
        // 实例化一个client选项，可选的，没有特殊需求可以跳过
        ClientProfile clientProfile = new ClientProfile();
        clientProfile.setHttpProfile(httpProfile);
        // 实例化要请求产品的client对象,clientProfile是可选的
        return new IaiClient(cred, "ap-chengdu", clientProfile);
    }

}
